﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using Maticsoft.DBUtility;

/// <summary>
///TestOnLine_CPS5DAL 的摘要说明
/// </summary>
public class TestOnLine_CPS5DAL
{
    /// <summary>
    /// 增加一条数据
    /// </summary>
    public int Add(Level_2.Model.TestOnLine_CPS5 model)
    {
        StringBuilder strSql = new StringBuilder();
        strSql.Append("insert into TestOnLine_CPS5(");
        strSql.Append("userName,feedbackContent,attachmentPath,type,userEmail)");
        strSql.Append(" values (");
        strSql.Append("@userName,@feedbackContent,@attachmentPath,@type,@userEmail)");
        SqlParameter[] parameters = {
					new SqlParameter("@userName", SqlDbType.VarChar,30),
					new SqlParameter("@feedbackContent", SqlDbType.VarChar,500),
					new SqlParameter("@attachmentPath", SqlDbType.VarChar,100),
                    new SqlParameter("@type", SqlDbType.Int),
                    new SqlParameter("@userEmail", SqlDbType.VarChar,50)};
        parameters[0].Value = model.userName;
        parameters[1].Value = model.feedbackContent;
        parameters[2].Value = model.attachmentPath;
        parameters[3].Value = model.type;
        parameters[4].Value = model.UserEmail;

        return (int)DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
    }
}